<template>
    <view @tap.stop.prevent="__e" class="coupons-wrapper mask data-v-982a6c84" :data-event-opts="[['tap', [['close', ['$event']]]]]">
        <view @tap.stop.prevent="__e" class="coupons-content data-v-982a6c84" :data-event-opts="[['tap', [['', ['$event']]]]]">
            <view @tap="__e" class="close data-v-982a6c84" :data-event-opts="[['tap', [['close', ['$event']]]]]">
                <image class="data-v-982a6c84" src="https://img121.7dun.com/yuanqimali/kaishang/zsClose.png"></image>
            </view>
            <view class="tabs data-v-982a6c84">
                <view
                    @tap="__e"
                    :class="['tab-item', 'data-v-982a6c84', current === 0 ? 'active' : '']"
                    :data-current="0"
                    :data-event-opts="[['tap', [['currentChange', ['$event']]]]]"
                >
                    可用优惠券
                </view>
                <view
                    @tap="__e"
                    :class="['tab-item', 'data-v-982a6c84', current === 1 ? 'active' : '']"
                    :data-current="1"
                    :data-event-opts="[['tap', [['currentChange', ['$event']]]]]"
                >
                    不可用优惠券
                </view>
            </view>
            <swiper @change="__e" class="data-v-982a6c84" :current="current" :data-event-opts="[['change', [['currentChange2', ['$event']]]]]">
                <swiper-item class="data-v-982a6c84">
                    <scroll-view @scrolltolower="__e" class="data-v-982a6c84" :data-event-opts="[['scrolltolower', [['fetchList', ['$event']]]]]" :scrollY="true">
                        <view class="coupon-list margin-h data-v-982a6c84">
                            <coupon-item
                                :active="1"
                                :backgroundColor="false ? 'rgba(245, 35, 2, 0.1)' : '#ffffff'"
                                @__l="__l($event, { eventOpts: [['^click', [['onClick', ['$0'], [[['usableCoupons', 'uuid', item.uuid]]]]]]] })"
                                @click="__e($event, { eventOpts: [['^click', [['onClick', ['$0'], [[['usableCoupons', 'uuid', item.uuid]]]]]]] })"
                                class="data-v-982a6c84"
                                :coupon="item"
                                :data-event-opts="[['^click', [['onClick', ['$0'], [[['usableCoupons', 'uuid', item.uuid]]]]]]]"
                                :isSelected="currentCoupon.id === item.id"
                                :vueId="'793caca4-1-' + __i0__"
                                v-for="(item, __i0__) in usableCoupons"
                                :key="__i0__"
                            ></coupon-item>
                            <no-data @__l="__l" class="data-v-982a6c84" title="暂无可用优惠券" vueId="793caca4-2" v-if="!$root.g0"></no-data>
                        </view>
                    </scroll-view>
                </swiper-item>
                <swiper-item class="data-v-982a6c84">
                    <scroll-view class="data-v-982a6c84" :scrollY="true">
                        <view class="coupon-list margin-h data-v-982a6c84">
                            <coupon-item
                                :active="0"
                                @__l="__l"
                                class="data-v-982a6c84"
                                :coupon="item"
                                unActiveText="不可用"
                                :vueId="'793caca4-3-' + __i1__"
                                v-for="(item, __i1__) in unusableCoupons"
                                :key="__i1__"
                            ></coupon-item>
                            <no-data @__l="__l" class="data-v-982a6c84" title="暂无不可用优惠券" vueId="793caca4-4" v-if="!$root.g1"></no-data>
                        </view>
                    </scroll-view>
                </swiper-item>
            </swiper>
        </view>
    </view>
</template>

<script>
import noData from '@/components/NoData/NoData';
import couponItem from '@/components/UsableCouponPopup/components/CouponItem';
import tabBar from '@/components/TabBar/tabBar';
(global.webpackJsonp = global.webpackJsonp || []).push([
    ['components/UsableCouponPopup/UsableCouponPopup'],
    {
        '24a1': function (n, t, o) {
            'use strict';

            o.d(t, 'b', function () {
                return u;
            });
            o.d(t, 'c', function () {
                return c;
            });
            o.d(t, 'a', function () {
                return e;
            });
            var e = {
                NoData: function () {
                    return o.e('components/NoData/NoData').then(o.bind(null, 'cafe'));
                }
            };
            var u = function () {
                this.$createElement;
                var n = (this._self._c, this.usableCoupons.length);
                var t = this.unusableCoupons.length;
                this.setData(
                    Object.assign(
                        {},
                        {
                            $root: {
                                g0: n,
                                g1: t
                            }
                        }
                    )
                );
            };
            var c = [];
        },
        3858: function (n, t, o) {
            'use strict';

            o.r(t);
            var e = o('24a1');
            var u = o('ab97');
            for (var c in u) {
                if (['default'].indexOf(c) < 0) {
                    (function (n) {
                        o.d(t, n, function () {
                            return u[n];
                        });
                    })(c);
                }
            }
            o('7d6a');
            var a = o('f0c5');
            var r = Object(a.a)(u.default, e.b, e.c, false, null, '982a6c84', null, false, e.a, void 0);
            t.default = r.exports;
        },
        6900: function (n, t, o) {
            'use strict';

            Object.defineProperty(t, '__esModule', {
                value: true
            });
            t.default = void 0;
            var e = {
                components: {
                    CouponItem: function () {
                        Promise.all([o.e('common/vendor'), o.e('components/UsableCouponPopup/components/CouponItem')])
                            .then(
                                function () {
                                    return resolve(o('df52'));
                                }.bind(null, o)
                            )
                            .catch(o.oe);
                    }
                },
                props: {
                    unusableCoupons: {
                        type: Array
                    },
                    usableCoupons: {
                        type: Array
                    },
                    currentCoupon: {
                        type: Object,
                        default: function () {
                            return {};
                        }
                    }
                },
                data: function () {
                    return {
                        current: 0,
                        count: 10
                    };
                },
                created: function () {},
                computed: {},
                methods: {
                    fetchList: function () {
                        this.$emit('load');
                    },
                    close: function () {
                        this.$emit('close');
                    },
                    currentChange: function (n) {
                        var t = n.currentTarget.dataset.current;
                        if (t !== this.current) {
                            this.current = t;
                        }
                    },
                    currentChange2: function (n) {
                        var t = n.detail.current;
                        if (t !== this.current) {
                            this.current = t;
                        }
                    },
                    onClick: function (n) {
                        this.$emit('change', n);
                        this.$emit('close');
                    }
                }
            };
            t.default = e;
        },
        '7d6a': function (n, t, o) {
            'use strict';

            var e = o('a1dc');
            o.n(e).a;
        },
        a1dc: function (n, t, o) {},
        ab97: function (n, t, o) {
            'use strict';

            o.r(t);
            var e = o('6900');
            var u = o.n(e);
            for (var c in e) {
                if (['default'].indexOf(c) < 0) {
                    (function (n) {
                        o.d(t, n, function () {
                            return e[n];
                        });
                    })(c);
                }
            }
            t.default = u.a;
        }
    }
]);
(global.webpackJsonp = global.webpackJsonp || []).push([
    'components/UsableCouponPopup/UsableCouponPopup-create-component',
    {
        'components/UsableCouponPopup/UsableCouponPopup-create-component': function (n, t, o) {
            o('543d').createComponent(o('3858'));
        }
    },
    [['components/UsableCouponPopup/UsableCouponPopup-create-component']]
]);
</script>
<style>
@import './UsableCouponPopup.css';
</style>
